<?php
if (!defined('admin')) {
    exit();
}

$data = getPost('data');
$keys = getPost('keys');

if ($keys && $data) {
    langSetKeys($keys);
    foreach ($data as $file => $langdata) {
        langPutFile($file . '.json', $langdata);
    }
    echo resp_success_json('保存成功');
} else {
    echo resp_error_json('提交数据错误，请刷新后重试');
}